/*
 * AViewEvent.java
 *
 * Created on June 16, 2007, 10:13 PM
 *
 * Copyright 2008 David D. Emory
 * 
 * This file is part of Five Points. See <http://www.fpdev.org> for
 * additional information regarding the project.
 * 
 * Five Points is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Five Points is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Five Points.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.fpdev.apps.admin;

import java.util.HashMap;
import java.util.Map;
import org.fpdev.core.basenet.BLink;
import org.fpdev.core.basenet.BNode;

/**
 *
 * @author demory
 */
public class ACEvent {

  private int type_;
  private Map<String, Object> props_;

  /** Creates a new instance of AViewEvent */
  public ACEvent(int type) {
    //this(type, new Properties());
    type_ = type;
    props_ = new HashMap<String, Object>();
  }

  /*public AViewEvent(int type, Properties props) {
  type_ = type;
  props_ = props;
  }*/
  public void setProperty(String key, String val) {
    props_.put(key, val);
  }

  public void setProperty(String key, int val) {
    props_.put(key, new Integer(val));
  }

  public void setProperty(String key, double val) {
    props_.put(key, new Double(val));
  }

  public void setProperty(String key, boolean val) {
    props_.put(key, new Boolean(val));
  }

  public void setProperty(String key, Object val) {
    props_.put(key, val);
  }

  public String getStringProperty(String key) {
    return (String) props_.get(key);
  }

  public double getDoubleProperty(String key) {
    return ((Double) props_.get(key)).doubleValue();
  }

  public int getIntegerProperty(String key) {
    return ((Integer) props_.get(key)).intValue();
  }

  public boolean getBooleanProperty(String key) {
    return ((Boolean) props_.get(key)).booleanValue();
  }

  public BNode getNodeProperty(String key) {
    return (BNode) props_.get(key);
  }

  public BLink getLinkProperty(String key) {
    return (BLink) props_.get(key);
  }

  public Object getProperty(String key) {
    return props_.get(key);
  }

  public int getType() {
    return type_;
  }
}
